package com.sunwayworld.basemodule.coredata.method.resource.impl;

import com.sunwayworld.basemodule.coredata.method.validators.LimsMethodCerUserSubmitValidator;
import com.sunwayworld.basemodule.coredata.method.validators.LimsMethodDeleteTableValidator;
import com.sunwayworld.framework.validator.data.annotation.ValidateDataWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sunwayworld.basemodule.coredata.method.resource.LimsMethodCertificateUserResource;
import com.sunwayworld.basemodule.coredata.method.service.LimsMethodCertificateUserService;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;

@LogModule("SOP授权人员表")
@RestController
@GikamBean
public class LimsMethodCertificateUserResourceImpl implements LimsMethodCertificateUserResource {

    @Autowired
    private LimsMethodCertificateUserService limsMethodCertificateUserService;

    @Override
    public LimsMethodCertificateUserService getService() {
        return limsMethodCertificateUserService;
    }

    @Log(value = "新增SOP授权人员表", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Log(value = "提交", type = LogType.UPDATE)
    @Override
    @ValidateDataWith(LimsMethodCerUserSubmitValidator.class)
    public void startProcess(RestJsonWrapperBean wrapper) {
        getService().startProcess(wrapper);
    }

}
